﻿using UnityEngine;

namespace ShootingEditor2D
{
    public class Gun : MonoBehaviour
    {
        private Bullet _bullet;

        private void Awake()
        {
            _bullet = transform.Find("Bullet").GetComponent<Bullet>();
        }
        
        public void Shoot()
        {
            var transform1 = _bullet.transform;
            var bullet = Instantiate(transform1, transform1.position,transform1.rotation);
            // 统一缩放值
            bullet.transform.localScale = _bullet.transform.lossyScale;
            bullet.gameObject.SetActive(true);
        }

    }
}